package com.nekrashevych;

public enum Projects {
    MT_DTO("mt-dto"),
    SERVICES("services"),
    ANNOTATIONS("annotations"),
    DOCS("documentation"),
    EAR("ear"),
    WEB("web-client"),
    WS("web-service"),
    COMMON("common");

    private final String sourceFolder;

    private Projects(String sourceFolder) {
        this.sourceFolder = sourceFolder;
    }

    public String getSourceFolder() {
        return sourceFolder;
    }

    public String getProjectFolder(String root) {
        if (root.endsWith("/") || root.endsWith("\\")) {
            return root + sourceFolder;
        }
        return root + "/" + sourceFolder;
    }

    public String getJavaSourceFolder(String root) {
        return getProjectFolder(root) + "/src/main/java/";
    }

    public String getJavaResourceFolder(String root) {
        return getProjectFolder(root) + "/src/main/resources/";
    }

    public String getWebSourceFolder(String root) {
        return getProjectFolder(root) + "/src/main/webapp/";
    }

    public String getJavaTestSourcesFolder(String root) {
        return getProjectFolder(root) + "/src/test/java/";
    }

    public String getJavaTestSourceFolder(String root) {
        return getProjectFolder(root) + "/src/test/java/";
    }
}
